Filter hook 'rest_prepare_{$this->taxonomy}'
in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php at line 940
Description
Filters the term data for a REST API response. The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. Possible hook names include: - `rest_prepare_category` - `rest_prepare_post_tag` Allows modification of the term data right before it is returned.
Occurrences
Filename |
Line Number |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php |
940 |
wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php |
143 |
Parameters
Type |
Name |
Description |
WP_REST_Response |
$response |
The response object. |
WP_Term |
$item |
The original term object. |
WP_REST_Request |
$request |
Request used to generate the response. |
PHP Doc
/**
* Filters the term data for a REST API response.
*
* The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
*
* Possible hook names include:
*
* - `rest_prepare_category`
* - `rest_prepare_post_tag`
*
* Allows modification of the term data right before it is returned.
*
* @since 4.7.0
*
* @param WP_REST_Response $response The response object.
* @param WP_Term $item The original term object.
* @param WP_REST_Request $request Request used to generate the response.
*/